<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>个人记事网</title>
    <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400" rel="stylesheet"/>
    <!-- https://fonts.google.com/ -->
    <link href="css/bootstrap.min.css" rel="stylesheet"/> <!-- https://getbootstrap.com/ -->
    <link href="fontawesome/css/all.min.css" rel="stylesheet"/> <!-- https://fontawesome.com/ -->
    <link href="css/templatemo-diagoona.css" rel="stylesheet"/>
    <!--

    TemplateMo 550 Diagoona

    https://templatemo.com/tm-550-diagoona

    -->
    <style>
        /* 弹窗样式 */
        .modal {
            display: none;
            position: absolute;
            z-index: 1;
            background-color: rgba(0, 0, 0, 0.2);
            width: 350px;
            height: 450px;
        }

        .modal img {
            display: block;
            margin: 60px 10px 10px 55px;
            max-width: 100%;
            max-height: 70%;
        }

        .close {
            color: #ffffff;
            position: absolute;
            top: 15px;
            right: 25px;
            font-size: 30px;
            font-weight: bold;
            cursor: pointer;
        }
    </style>
</head>
<body>
<div class="tm-container">
    <div>
        <div class="tm-row pt-4">
            <div class="tm-col-left">
                <div class="tm-site-header media">
                    <i class="fas fa-umbrella-beach fa-3x mt-1 tm-logo"></i>
                    <div class="media-body">
                        <h1 class="tm-sitename text-uppercase">个人网站</h1>
                        <p class="tm-slogon">Bobby</p>
                    </div>
                </div>
            </div>
            <div class="tm-col-right">
                <nav class="navbar navbar-expand-lg" id="tm-main-nav">
                    <button class="navbar-toggler toggler-example mr-0 ml-auto" type="button"
                            data-toggle="collapse" data-target="#navbar-nav"
                            aria-controls="navbar-nav" aria-expanded="false" aria-label="Toggle navigation">
                        <span><i class="fas fa-bars"></i></span>
                    </button>
                    <div class="collapse navbar-collapse tm-nav" id="navbar-nav">
                        <ul class="navbar-nav text-uppercase">
                            <li class="nav-item">
                                <a class="nav-link tm-nav-link" href="index.html">主页</a>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link tm-nav-link" href="about.html">关于</a>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link tm-nav-link" href="services.html">解决方案</a>
                            </li>
                            <li class="nav-item active">
                                <a class="nav-link tm-nav-link" href="contact.html">联系 <span
                                        class="sr-only">(current)</span></a>
                            </li>
                        </ul>
                    </div>
                </nav>
            </div>
        </div>

        <div class="tm-row">
            <div class="tm-col-left"></div>
            <main class="tm-col-right tm-contact-main"> <!-- Content -->
                <section class="tm-content tm-contact">
                    <h2 class="mb-4 tm-content-title">联系我</h2>
                    <p class="mb-85">很高兴能让您停留下来，有任何需要可以随时联系我，微信号<a href="#" id="showImageLink" class="contact-weixin">QGDong9527</a>
                    </p>
                    <form id="contact-form" action="" method="POST">
                        <div class="form-group mb-4">
                            <input type="text" name="name" class="form-control" placeholder="Name" required=""/>
                        </div>
                        <div class="form-group mb-4">
                            <input type="email" name="email" class="form-control" placeholder="Email" required=""/>
                        </div>
                        <div class="form-group mb-5">
                            <textarea rows="6" name="message" class="form-control" placeholder="Message..."
                                      required=""></textarea>
                        </div>
                        <div class="text-right">
                            <button type="submit" class="btn btn-big btn-primary">发送</button>
                        </div>
                    </form>
                </section>
            </main>
        </div>
    </div>

    <div class="tm-row">
        <div class="tm-col-left text-center">
            <ul class="tm-bg-controls-wrapper">
                <li class="tm-bg-control active" data-id="0"></li>
                <li class="tm-bg-control" data-id="1"></li>
                <li class="tm-bg-control" data-id="2"></li>
            </ul>
        </div>
        <div class="tm-col-right tm-col-footer">
            <footer class="tm-site-footer text-right">
                <p class="mb-0">Copyright 2023 Bobby
                    |<a rel="nofollow" target="_parent" href="https://beian.miit.gov.cn/" class="tm-text-link">桂ICP备2023000866号-1</a>
                </p>
            </footer>
        </div>
    </div>

    <div class="tm-bg"> <!-- Diagonal background design -->
        <div class="tm-bg-left"></div>
        <div class="tm-bg-right"></div>
    </div>
</div>
<div id="imageModal" class="modal">
    <span class="close">&times;</span>
    <img src="img/weixin-scan.jpg" alt="展示图片">
</div>
<script src="js/jquery-3.4.1.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/jquery.backstretch.min.js"></script>
<script src="js/templatemo-script.js"></script>
<script>
    const showImageLink = document.getElementById('showImageLink');
    const imageModal = document.getElementById('imageModal');
    const closeButton = document.querySelector('.close');

    showImageLink.addEventListener('click', function (event) {
        event.preventDefault(); // 阻止默认链接行为
        imageModal.style.display = 'none';
        const linkRect = showImageLink.getBoundingClientRect();
        const modalWidth = imageModal.offsetWidth;
        imageModal.style.left = (linkRect.right - 200) + 'px';
        imageModal.style.top = (linkRect.top + linkRect.height / 2 + 20 - imageModal.offsetHeight / 2) + 'px';
        imageModal.style.display = 'block';
    });

    closeButton.addEventListener('click', function () {
        imageModal.style.display = 'none';
    });

    window.addEventListener('click', function (event) {
        if (event.target == imageModal) {
            imageModal.style.display = 'none';
        }
    });

    document.addEventListener('click', function (event) {
        if (!imageModal.contains(event.target) && event.target != showImageLink) {
            imageModal.style.display = 'none';
        }
    });
</script>
</body>
</html>
